// The Vue build version to load with the `import` command
// (runtime-only or standalone) has been set in webpack.base.conf with an alias.
import Vue from 'vue'
import 'element-ui/lib/theme-chalk/index.css';
import App from './App'
import router from './router'
import ElementUI from 'element-ui';
import store from './store'
// import 'element-ui/lib/theme-chalk/index.css';

router.beforeEach((to, from, next) => {
  // console.log(to, from, next)
  // console.log(store)
  // console.log(to.params.container)
  console.log(to, from, next)
  if(to.params.container==='tu1'  && store.state.isChangeRouete===false){
    // alert('666')
    // 添加一个方法进全局
    console.log(to.params.container)
    
    next('/home/renli')
    store.commit('tianjia')
  }
  else if( to.params.container!=='tu1'){
    store.commit('quxiao')
    // alert('666')ni
    next()
  }
  
  else{
    next()
  }
  
 })

Vue.config.productionTip = false
Vue.use(ElementUI);
/* eslint-disable no-new */
new Vue({
  el: '#app',
  router,
  store,
  components: { App },
  template: '<App/>'
})
